class Person < ActiveRecord::Base
  has_many :votes
  has_many :participants
  
  def last_first
    name = "#{self.last_name}, #{self.first_name}"
    name << " #{self.middle_name}" unless self.middle_name.blank?
    return name
  end
  
  def full_display
    name = self.first_name
    name << " #{self.middle_name}" unless self.middle_name.blank?
    name << " #{self.last_name}" if self.last_name
    assoc = ''
    assoc = self.title if self.title
    if self.organization
      assoc << ", " unless assoc.empty?
      assoc << self.organization
    end
    name << ":  #{assoc}" unless assoc.empty?
    return name
  end
    
end
